(bug 24837) Fix issue where namespaces which were localised but not defined were...
authorAndrew Garrett <werdna@users.mediawiki.org>
Fri, 20 Aug 2010 05:32:24 +0000 (05:32 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Fri, 20 Aug 2010 05:32:24 +0000 (05:32 +0000)
languages/Language.php

index b0b2a4c..3056143 100644 (file)
@@ -256,6 +256,14 @@ class Language {
                                $this->namespaceNames[NS_PROJECT_TALK] =
                                        $this->fixVariableInNamespace( $talk );
                        }
+                       
+                       # Sometimes a language will be localised but not actually exist on this wiki.
+                       $validNamespaces = MWNamespace::getValidNamespaces();
+                       foreach( $this->namespaceNames as $key => $text ) {
+                               if ( ! in_array( $key, $validNamespaces ) ) {
+                                       unset( $this->namespaceNames[$key] );
+                               }
+                       }
 
                        # The above mixing may leave namespaces out of canonical order.
                        # Re-order by namespace ID number...